package cn.valo.org.service.impl;

import cn.valo.basic.query.BaseQuery;
import cn.valo.basic.util.PageList;
import cn.valo.org.domain.Shop;
import cn.valo.org.domain.ShopAuditLog;
import cn.valo.org.mapper.ShopAuditLogMapper;
import cn.valo.org.mapper.ShopMapper;
import cn.valo.org.service.IShopAuditLogService;
import cn.valo.basic.service.impl.BaseServiceImpl;
import org.apache.velocity.runtime.directive.Foreach;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author valo
 * @since 2022-06-15
 */
@Service
public class ShopAuditLogServiceImpl extends BaseServiceImpl<ShopAuditLog> implements IShopAuditLogService {
    @Autowired
    private ShopMapper shopMapper;
    @Autowired
    private ShopAuditLogMapper shopAuditLogMapper;
    @Override
    public void save(ShopAuditLog shopAuditLog) {
        super.save(shopAuditLog);
        Shop shop = shopMapper.queryById(shopAuditLog.getShopId());
        shop.setState(shopAuditLog.getState());
        shopMapper.update(shop);
    }

    @Override
    public List<ShopAuditLog> queryByShopId(long id) {
        return shopAuditLogMapper.queryByShopId(id);
    }
}
